<?php

Loader::import('pspframework.utils.sessions.SessionHandlerInterface');
class CacheSession implements SessionHandlerInterface {

	public function open() {
		return true;
	}

	public function close() {
		return true;
	}

	public function read($id) {
		return Cache::read($id, Param::read('Session.handler.config'));
	}

	public function write($id, $data) {
		return Cache::write($id, $data, Param::read('Session.handler.config'));
	}

	public function destroy($id) {
		return Cache::delete($id, Param::read('Session.handler.config'));
	}
	public function gc($expires = null) {
		return Cache::gc(Param::read('Session.handler.config'), $expires);
	}

}
?>